package com.lankystar.logistucs.spring.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 车辆：ID、车牌、图片展示、行驶证、保险、白卡号、类型、状态、所属公司、时间戳
 * @author SYX
 *
 */
@Entity
@Table(name="truck")
public class Truck {

	private int truckId;
	private String plateNu;
	private String photo;
	private String driveLicense;
	private String insurance;
	private String cardNu;
	private TruckType truckType;
	private TruckStatus truckStatus;
	private String address;
	private Company company;
	private long createTime;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getTruckId() {
		return truckId;
	}
	public void setTruckId(int truckId) {
		this.truckId = truckId;
	}
	public String getPlateNu() {
		return plateNu;
	}
	public void setPlateNu(String plateNu) {
		this.plateNu = plateNu;
	}
	public String getPhoto() {
		return photo;
	}
	public void setPhoto(String photo) {
		this.photo = photo;
	}
	public String getDriveLicense() {
		return driveLicense;
	}
	public void setDriveLicense(String driveLicense) {
		this.driveLicense = driveLicense;
	}
	public String getInsurance() {
		return insurance;
	}
	public void setInsurance(String insurance) {
		this.insurance = insurance;
	}
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="truckType_Id")
	public TruckType getTruckType() {
		return truckType;
	}
	public void setTruckType(TruckType truckType) {
		this.truckType = truckType;
	}
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="truckStatus_Id")
	public TruckStatus getTruckStatus() {
		return truckStatus;
	}
	public void setTruckStatus(TruckStatus truckStatus) {
		this.truckStatus = truckStatus;
	}
	@ManyToOne
	@JoinColumn(name="company_Id")
	public Company getCompany() {
		return company;
	}
	public void setCompany(Company company) {
		this.company = company;
	}
	public long getCreateTime() {
		return createTime;
	}
	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}
	public String getCardNu() {
		return cardNu;
	}
	public void setCardNu(String cardNu) {
		this.cardNu = cardNu;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
}
